/*
 * Copyright (c) gitee.com/jiandong001.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

import { YogaBaselineFunction } from './YogaBaselineFunction';
import { YogaOverflow } from './YogaOverflow';
import { YogaValue } from './YogaValue';
import { YogaMeasureFunction } from './YogaMeasureFunction';
import { YogaPositionType } from './YogaPositionType';
import { YogaFlexDirection } from './YogaFlexDirection';
import { YogaAlign } from './YogaAlign';
import { YogaDirection } from './YogaDirection';
import { YogaJustify } from './YogaJustify';
import { YogaProps } from './YogaProps';
import { YogaEdge } from './YogaEdge';
import { YogaDisplay } from './YogaDisplay';
import { YogaWrap } from './YogaWrap';

export interface Inputs {
  /** Requests the data object to disable mutations of its inputs. */
  freeze(node: YogaNode, parent?: YogaNode): void;
}

export abstract class YogaNode implements YogaProps {

  /** The interface the {@link #getData()} object can optionally implement. */


  public abstract reset(): void;

  public abstract getChildCount(): number;

  public abstract getChildAt(i: number): YogaNode;

  public abstract addChildAt(child: YogaNode, i: number): void;

  public abstract setIsReferenceBaseline(isReferenceBaseline: boolean): void;

  public abstract isReferenceBaseline(): boolean;

  public abstract removeChildAt(i: number): YogaNode;

  /**
   * @returns the {@link YogaNode} that owns this {@link YogaNode}. The owner is used to identify
   *     the YogaTree that a {@link YogaNode} belongs to. This method will return the parent of the
   *     {@link YogaNode} when the {@link YogaNode} only belongs to one YogaTree or null when the
   *     {@link YogaNode} is shared between two or more YogaTrees.
   */
//  @Nullable
  public abstract getOwner(): YogaNode | null;

  /** @deprecated Use #getOwner() instead. This will be removed in the next version. */
//  @Deprecated
//  @Nullable
  public abstract getParent(): YogaNode | null;

  public abstract indexOf(child: YogaNode): number;

  public abstract calculateLayout(width: number, height: number,): void;

  public abstract hasNewLayout(): boolean;

  public abstract dirty(): void;

  public abstract isDirty(): boolean;

  public abstract copyStyle(srcNode: YogaNode): void;

  public abstract markLayoutSeen(): void;

  public abstract getStyleDirection(): YogaDirection;

  public abstract setDirection(direction: YogaDirection): void;

  public abstract getFlexDirection(): YogaFlexDirection;

  public abstract setFlexDirection(flexDirection: YogaFlexDirection): void;

  public abstract getJustifyContent(): YogaJustify;

  public abstract setJustifyContent(justifyContent: YogaJustify): void;

  public abstract getAlignItems(): YogaAlign;

  public abstract setAlignItems(alignItems: YogaAlign): void;

  public abstract getAlignSelf(): YogaAlign;

  public abstract setAlignSelf(alignSelf: YogaAlign): void;

  public abstract getAlignContent(): YogaAlign;

  public abstract setAlignContent(alignContent: YogaAlign): void;

  public abstract getPositionType(): YogaPositionType;

  public abstract setPositionType(positionType: YogaPositionType): void;

  public abstract getWrap(): YogaWrap;

  public abstract setWrap(flexWrap: YogaWrap): void;

  public abstract getOverflow(): YogaOverflow;

  public abstract setOverflow(overflow: YogaOverflow): void;

  public abstract getDisplay(): YogaDisplay;

  public abstract setDisplay(display: YogaDisplay): void;

  public abstract getFlex(): number;

  public abstract setFlex(flex: number): void;

  public abstract getFlexGrow(): number;

  public abstract setFlexGrow(flexGrow: number): void;

  public abstract getFlexShrink(): number;

  public abstract setFlexShrink(flexShrink: number): void;

  public abstract getFlexBasis(): YogaValue;

  public abstract setFlexBasis(flexBasis: number): void;

  public abstract setFlexBasisPercent(percent: number): void;

  public abstract setFlexBasisAuto(): void;

  public abstract getMargin(edge: YogaEdge): YogaValue;

  public abstract setMargin(edge: YogaEdge, margin: number): void;

  public abstract setMarginPercent(edge: YogaEdge, percent: number): void;

  public abstract setMarginAuto(edge: YogaEdge): void;

  public abstract getPadding(edge: YogaEdge): YogaValue;

  public abstract setPadding(edge: YogaEdge, padding: number): void;

  public abstract setPaddingPercent(edge: YogaEdge, percent: number): void;

  public abstract getBorder(edge: YogaEdge): number;

  public abstract setBorder(edge: YogaEdge, border: number): void;

  public abstract getPosition(edge: YogaEdge): YogaValue;

  public abstract setPosition(edge: YogaEdge, position: number): void;

  public abstract setPositionPercent(edge: YogaEdge, percent: number): void;

  public abstract getWidth(): YogaValue;

  public abstract setWidth(width: number): void;

  public abstract setWidthPercent(percent: number): void;

  public abstract setWidthAuto(): void;

  public abstract getHeight(): YogaValue;

  public abstract setHeight(height: number): void;

  public abstract setHeightPercent(percent: number): void;

  public abstract setHeightAuto(): void;

  public abstract getMinWidth(): YogaValue;

  public abstract setMinWidth(minWidth: number): void;

  public abstract setMinWidthPercent(percent: number): void;

  public abstract getMinHeight(): YogaValue;

  public abstract setMinHeight(minHeight: number): void;

  public abstract setMinHeightPercent(percent: number): void;

  public abstract getMaxWidth(): YogaValue;

  public abstract setMaxWidth(maxWidth: number): void;

  public abstract setMaxWidthPercent(percent: number): void;

  public abstract getMaxHeight(): YogaValue;

  public abstract setMaxHeight(maxheight: number): void;

  public abstract setMaxHeightPercent(percent: number): void;

  public abstract getAspectRatio(): number;

  public abstract setAspectRatio(aspectRatio: number): void;

  public abstract getLayoutX(): number;

  public abstract getLayoutY(): number;

  public abstract getLayoutWidth(): number;

  public abstract getLayoutHeight(): number;

  public abstract getLayoutMargin(edge: YogaEdge): number;

  public abstract getLayoutPadding(edge: YogaEdge): number;

  public abstract getLayoutBorder(edge: YogaEdge): number;

  public abstract getLayoutDirection(): YogaDirection;

  public abstract setMeasureFunction(measureFunction: YogaMeasureFunction): void;

  public abstract setBaselineFunction(baselineFunction: YogaBaselineFunction): void;

  public abstract isMeasureDefined(): boolean;

  public abstract isBaselineDefined(): boolean;

  public abstract setData(data: Object): void;

  public abstract getData(): Object | null;

  public abstract print(): void;

  public abstract cloneWithoutChildren(): YogaNode;

  public abstract cloneWithChildren(): YogaNode;
}
